from django.db import models
from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User


# Create your models here.
class LoginForm(forms.Form):
    username = forms.CharField(max_length=100)
    password = forms.CharField(widget=forms.PasswordInput(render_value=False),max_length=100)

    
class Profile(models.Model):
    user = models.ForeignKey(User, unique=True)
    username = models.CharField(max_length=100)
    email = models.EmailField(max_length=100)
    first = models.CharField(max_length=100)
    last = models.CharField(max_length=100)
    code = models.CharField(max_length=100)
    museum = models.CharField(max_length=100)
    
    def __unicode__(self):
        return self.museum
class RegisterForm(ModelForm):
    class Meta:
        model = Profile  
        exclude = ('user','museum') 
        widgets= {'password': forms.PasswordInput(render_value=False),}
        
class Painting(models.Model):
    CHOICES = (('temp','temp'),('temp2','temp2'))
    
    name = models.CharField(max_length=100)
    artist = models.CharField(max_length=100)
    description = models.TextField(max_length=1000)
    file = models.FileField(upload_to='audio')
    museum = models.ForeignKey(Profile)
   
class PaintingForm(ModelForm):
    class Meta:
        model = Painting
        
class Code(models.Model):
    code = models.CharField(max_length=100)
    museum = models.CharField(max_length=100)